<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>系统页面</title>

	<script type="text/javascript" src="${basePath}js/jquery/jquery-1.11.1.min.js"></script>

    <link href="${basePath}css/style.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" type="text/css" href="${basePath}css/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="${basePath}css/easyui/themes/color.css">
	<link rel="stylesheet" type="text/css" href="${basePath}css/easyui/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="${basePath}css/default.css">
	<link rel="stylesheet" type="text/css" href="${basePath}css/form/form.css">

	<link href="${basePath}css/index.css" rel="stylesheet" type="text/css" />
	<script src="${basePath}js/easyui/jquery.easyui.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="${basePath}js/easyui/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="${basePath}js/marquee/jquery.marquee.min.js"></script>

	<style>
		.marquee {

			width: 1000px;
			overflow: hidden;
			text-align: center;
			color: black;
			font-style:italic;
		}

		ul li{
			font-size: 14px;
		}

	</style>
	
	<script type="text/javascript">
		var basePath = "${basePath}";
		function set() {

			var weather = JSON.parse(localStorage.getItem("weather"));
			// var arr = [
			// 	weather.ymd + "年,农历" + weather.lunar ,
			// 	"苏州天气:" + weather.type + "," + weather.low + "," + weather.high ,
			// 	"风向:" + weather.fx + ",风力:" +weather.fl,
			// 	weather.notice];
			var arr = [
				"苏州天气:" + weather.type + "," + weather.low + "," + weather.high +
				",风向:" + weather.fx + ",风力:" +weather.fl];

			$("ul li").each(function (index) {
				$(this).text(arr[index]);
			});

			$("#username").html("当前用户：" + localStorage.getItem("username"));
		}

        function logout() {
			parent.$.messager.confirm('提示', '你确定要退出吗?',function(r){
				if(r){
					$.ajax({
						type:"post",
						url:basePath + "logout",
						beforeSend: function(request) {
							request.setRequestHeader("header", localStorage.getItem("token"));
						},
						cache:false,
						dataType: "json", // this is important
						success:function(result) {
							localStorage.setItem("token","");
							localStorage.setItem("refreshToken","");
							localStorage.setItem("expireTime","");
							localStorage.setItem("logout","true");
							parent.location.href = basePath;
						}
					});

				}
			});
		}
	</script>
</head>
<body class="topbody" onload="set();">
    <div class="topleft">
		<div style="height: 68px;">&nbsp;</div>
		<marquee class="marquee" direction="right" width="100%" align="absbottom"  behavior="scroll" onmouseover=this.stop(); onmouseout=this.start();>
			<ul>
				<li></li>
			</ul>
		</marquee>
    </div>
            
    <div class="topright">    
	    <ul>
	    <li>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#"  onclick="logout();">退出</a></li>
	    </ul>
     
	     <div>
		    <div class="user">
		    	<span id="username"></span>
		    </div>     			
	     </div>
    
    
    </div>
    
</body>


</html>